package com.kaifamiao.month04.day18;

import java.util.Iterator;

public class MyListTest {

    public static void main(String[] args) {
        MyList list = new MyList();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");
        System.out.println(list.size());

        Iterator it = list.iterator();

        while (it.hasNext()) {
            String str = (String)it.next();
            System.out.println(str);
        }
        list.set(0, "yyy");
        System.out.println(list);

        list.add(1,"xxx");
        System.out.println(list);

        list.remove(0);
        System.out.println(list);

    }
}
